'use strict';

//也可以这样写: ...controller('mainCtrl',['$scope',function($scope){}]);
angular.module('app').controller('meCtrl',['$scope','$http','$state','cache',function($scope, $http, $state, cache){
    if(cache.get('name')){
        $scope.name = cache.get('name');
        $scope.image = cache.get('image');
    }
    $scope.logout = function(){
        cache.remove('id');
        cache.remove('name');
        cache.remove('iamge');
        $state.go('main');
    }
}]);